<template>
    <div class="appcontainer">
        <div class="container" v-html="yszccontent">

        </div>
    </div>
</template>
<script>
    export default {
        props: [],
        components: {},
        data() {
            return {
                language: '',
                coreList: [],
                pageNum: 1,
                pageSize: 10,
                cState: 1,
                yszccontent: null
            };
        },
        created() {
            this.language = sessionStorage.getItem('language')
            window.addEventListener('setItem', this.languages);
            this.getData()
        },
        methods: {
            // 监听session中language的变化
            languages(e) {
                console.log(e, 8888888888888)
                this.language = sessionStorage.getItem('language')
                this.getData()
            },
            getData() {
                this.axios
                    .get('/system/content/list?pageNum=1&pageSize=10&cState=1&cDataType=4&cLanguage=' + this.language).then(res => {
                        if (res.data.code == 200) {
                            if (res.data.rows && res.data.rows.length != 0) {
                                this.yszccontent = res.data.rows[0].cContent
                            }
                        }
                    })
            }
        },
        beforeDestroy() {
            this.language = null
            window.removeEventListener('setItem', this.languages);
        },
    }
</script>
<style scoped>
    .appcontainer {
        width: 100%;
        background-color: #fff;
    }

    .container {
        width: 70%;
        margin: 0 auto;
        padding: 40px 0;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        align-items: center;
        font-size: 20px;
    }

    .bigtitle {
        font-size: 32px;
        font-weight: 600;
        margin-bottom: 40px;
    }
</style>